<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0s">
<title>Register</title>
	<style type="text/css">
		.content{
			width:300px;
			height:auto;
			margin: 10px auto;
		}
		.errorMessage {
			color: red;
			text-align: center;
		}
	</style>
</head>
<body>
	<div class="content">
	<form action="regist" method="post">
			<table border="0" cellpadding="3">
				<caption> <h1>Register</h1> </caption>
				 <tr>
				 	<td>
				 		<s:textfield  name="newuser.name" label="用户名" placeholder="请输入用户名" ></s:textfield>
				 	</td>
				 </tr>
				 <tr>
				 	<td></td>
				 </tr>
				 <tr>
				 	<td>
				 		<s:textfield  name="newuser.password" label="密码" placeholder="请输入密码" ></s:textfield>
				 	</td>
				 </tr>
				 <tr>
				 	 <td></td>
				 </tr>
				 <tr>
				 	<td>
				 		<s:textfield  name="repassword" label="确认密码" placeholder="请输入确认密码"></s:textfield> 
				 	</td>
				 </tr>
				 <tr>
				 	<td></td>
				 </tr>
				 <tr>
				 	<td></td>
				 	<td>
				 		<input type="submit" value="注册" /> 
				 	</td>
				 </tr>
			</table>
		</form>
	</div>
	<s:if test="#session['success']">
		<script type="text/javascript">
		alert("Success!!!");
		window.location.href="./login.jsp";
		</script>
		<% session.setAttribute("success",false); %>
	</s:if>
	<s:if test="#session['sensitive']">
		<script type="text/javascript">
			alert("注册的账户中含有敏感词汇，请更正！！！");
		</script>
	</s:if>
		<% session.setAttribute("sensitive", false); %>
	
</body>
</html>